package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysLotteryMapper;
import com.ruoyi.system.domain.SysLottery;
import com.ruoyi.system.service.ISysLotteryService;

/**
 * 业务数据Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-08
 */
@Service
public class SysLotteryServiceImpl implements ISysLotteryService
{
    @Autowired
    private SysLotteryMapper sysLotteryMapper;

    /**
     * 查询业务数据
     *
     * @param id 业务数据主键
     * @return 业务数据
     */
    @Override
    public SysLottery selectSysLotteryById(Long id)
    {
        return sysLotteryMapper.selectSysLotteryById(id);
    }

    /**
     * 查询业务数据列表
     *
     * @param sysLottery 业务数据
     * @return 业务数据
     */
    @Override
    public List<SysLottery> selectSysLotteryList(SysLottery sysLottery)
    {
        return sysLotteryMapper.selectSysLotteryList(sysLottery);
    }

    /**
     * 新增业务数据
     *
     * @param sysLottery 业务数据
     * @return 结果
     */
    @Override
    public int insertSysLottery(SysLottery sysLottery)
    {
        sysLottery.setCreateTime(DateUtils.getNowDate());
        return sysLotteryMapper.insertSysLottery(sysLottery);
    }

    /**
     * 修改业务数据
     *
     * @param sysLottery 业务数据
     * @return 结果
     */
    @Override
    public int updateSysLottery(SysLottery sysLottery)
    {
        sysLottery.setUpdateTime(DateUtils.getNowDate());
        return sysLotteryMapper.updateSysLottery(sysLottery);
    }

    /**
     * 批量删除业务数据
     *
     * @param ids 需要删除的业务数据主键
     * @return 结果
     */
    @Override
    public int deleteSysLotteryByIds(Long[] ids)
    {
        return sysLotteryMapper.deleteSysLotteryByIds(ids);
    }

    /**
     * 删除业务数据信息
     *
     * @param id 业务数据主键
     * @return 结果
     */
    @Override
    public int deleteSysLotteryById(Long id)
    {
        return sysLotteryMapper.deleteSysLotteryById(id);
    }

    @Override
    public List<SysLottery> getSysLotteryList() {
        return sysLotteryMapper.getSysLotteryList();
    }
}
